package com.haoshuang.zhouzhoubang.ui.dialog

import android.content.Context

import android.widget.ImageView
import android.widget.TextView
import com.haoshuang.zhouzhoubang.R


import com.lnkj.jialubao.utils.AccountUtils
import com.lxj.xpopup.core.BottomPopupView
import com.mufeng.libs.utils.view.visible
import com.mufeng.libs.utils.view.visibleOrGone


class SmDialog2(context: Context, str :String, private val showBaoXian: Boolean = false, private val onSubmit: (str:Int) -> Unit) : BottomPopupView(context){
    override fun getImplLayoutId(): Int = R.layout.dialog_sm
    var str2=str
    override fun initPopupContent() {
        super.initPopupContent()
        var rl_root=findViewById<ImageView>(R.id.tvGb2)
        var tvGb2=findViewById<TextView>(R.id.tvGb)
        var tvGb5=findViewById<TextView>(R.id.tvGb5)
        var tvDesc=findViewById<TextView>(R.id.tvDesc)
        tvDesc.setText(str2)
        tvGb2.text="确认上门"
        tvGb5.visible()
        var tvCommit=findViewById<TextView>(R.id.tvCommit)
        val tvBaoXianTip = findViewById<TextView>(R.id.tvBaoXianTip)
        tvBaoXianTip.visibleOrGone(AccountUtils.user?.insurance_status == "1")
        rl_root.setOnClickListener {
            dismiss()
        }
        tvGb2.setOnClickListener {
            dismiss()
            onSubmit(1)
        }
        tvGb5.setOnClickListener {
            dismiss()
        }
        tvCommit.setOnClickListener {
            dismiss()

        }
    }


}